import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Element from "element-plus"
import 'element-plus/theme-chalk/index.css'
import { i18n } from "@/i18n/index"
import "@/utils/rem"
import MvFullPage from 'mv-full-page'
import "../node_modules/mv-full-page/dist-lib/style.css";
import axios from 'axios';
import VueAxios from 'vue-axios'
import VueCookies from 'vue-cookies'
import 'element-plus/theme-chalk/base.css'
const app = createApp(App)

import { toast } from "@/components/toast/index";
app.config.globalProperties.$toast = toast;
app.use(store).use(router).use(i18n).use(Element).use(MvFullPage).use(VueAxios, axios).mount('#app');
app.config.globalProperties.$cookies = VueCookies;
router.afterEach((to) => {
    if (to.path == '/application/rules/routine' || to.path == '/application/rules/bacteria' || to.path == '/application/rules/protein') {
        return;
    } else {
        window.scrollTo(0, 0); // 切换路由之后滚动条始终在最顶部
    }
});



